package com.sweetguy.dto;

import com.sweetguy.constant.RE;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

@Schema(name = "秒杀明细添加DTO")
@Data
public class SeckillDetailInsertDTO implements Serializable, RE {

    @NotEmpty(message = "描述不能为空")
    @Schema(description = "描述")
    @Pattern(regexp = INFO_RE, message = INFO_RE_MSG)
    private String info;

    @NotNull(message = "秒杀价格不能为空")
    @Schema(description = "秒杀价格")
    private Integer skPrice;

    @NotNull(message = "秒杀数量不能为空")
    @Schema(description = "秒杀数量")
    private Integer skCount;

    @NotNull(message = "课程ID不能为空")
    @Schema(description = "秒杀课程主键,课程表外键")
    private Long fkCourseId;

    @NotNull(message = "活动ID不能为空")
    @Schema(description = "秒杀活动主键,秒杀表外键")
    private Long fkSeckillId;
}
